﻿DELIMITER //

--
--
DROP PROCEDURE IF EXISTS dsZeusPackageInventoryInfo
//

-- HU - Rakomány info
-- EN - Package information
--
--
CREATE PROCEDURE dsZeusPackageInventoryInfo 
  (_AccessToken INTEGER, _Code VARCHAR(20))
BEGIN
  DECLARE _Rows INTEGER;
  DECLARE _UserID INTEGER;
  DECLARE _Lang VARCHAR(10);

  --
  --
  CALL spAccessTokenCheck(_AccessToken, _UserID, _Lang);
  

  -- HU - Visszaadja ennek a Rakománynak az adatait
  -- EN - Get the package details
  --
  SELECT p.Code, p.ArticleCode, p.ArticleName, 
    
         CAST(p.Expired as DATE) Expired, 
         
         i.Location1, i.Quantity1, i.Location2, i.Quantity2, p.UnitCode, '' Notes

    FROM ZeusPackage p
    LEFT JOIN ZeusInventory i ON p.Code = i.PackageCode
   WHERE p.Code = _Code;

END
//
